% This script generates Figure A.1 in the online appendix.
% Figure A.1: Firm Investment-to-Value Added Ratio

% The data for "Nonfinancial Corporate Business; Gross Fixed Investment,
% Nonresidential Structures, Equipment, and Intellectual Property Products,
% Transactions" is from the Financial Accounts of the U.S.
% The data is available on FRED as series BOGZ1FA105013005Q (FA105013005.Q
% in the Financial Accounts).
% Source URL: https://fred.stlouisfed.org/series/BOGZ1FA105013005Q

% The data for "Gross value added of nonfinancial corporate business" is
% from the BEA.
% The data is available in FRED as series A455RC1Q027SBEA (and is reported
% in the Financial Accounts as FA106902501.Q).
% Source URL: https://fred.stlouisfed.org/series/A455RC1Q027SBEA

% Both series have been converted to annual frequencies and the units of
% the investment data has been converted from millions of $ to billions of
% $.
%% Load data and model-generated results from benchmark calibration and counterfactual experiments.
clearvars;
Data = table2array(readtable('inv_shares.xlsx','Range','B13:D63'));
inv = Data(:,1);
va = Data(:,2);
year = Data(:,3);
figure(101)
plot(year,inv./va*100,LineStyle='-',LineWidth=2,Color='k');
xlim([1949 2001]);
xticks(1950:10:2000);
ylim([-1 31]);
yticks(0:5:30);
set(gca,'box','off','TickDir','out','Fontsize',14);
ylabel('Percent of Gross Value Added','FontSize',14);
grid on
%% Save Figure A.1 in PDF and EPS file formats.
saveas(gcf,'figA-1.pdf');
saveas(gcf,'figA-1','epsc');